package com.cdbkj.cloud.pos.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.cdbkj.cloud.pos.R;

public class WarnFragment extends Fragment {
    private static final String ARG_PARAM1 = "msg";

    private String msg;

    protected View rootView;

    public WarnFragment() {
    }

    public static WarnFragment newInstance(String msg) {
        WarnFragment fragment = new WarnFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, msg);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            msg = getArguments().getString(ARG_PARAM1);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_warn, container, false);
        initView(rootView);
        return rootView;
    }

    private void initView(View rootView) {
        TextView msg_tv = rootView.findViewById(R.id.msg_tv);
        msg_tv.setText(msg);
    }
}
